
package com.microweb.toastmaster.service.impl;

import java.util.List;

import com.microweb.toastmaster.service.impl.BaseManager;
import com.microweb.toastmaster.model.TMProject;
import com.microweb.toastmaster.dao.TMProjectDao;
import com.microweb.toastmaster.service.TMProjectManager;

public class TMProjectManagerImpl extends BaseManager implements TMProjectManager {
    private TMProjectDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setTMProjectDao(TMProjectDao dao) {
        this.dao = dao;
    }

    /**
     * @see com.microweb.toastmaster.service.TMProjectManager#getTMProjects(com.microweb.toastmaster.model.TMProject)
     */
    public List getTMProjects(final TMProject tMProject) {
        return dao.getTMProjects(tMProject);
    }

    /**
     * @see com.microweb.toastmaster.service.TMProjectManager#getTMProject(String id)
     */
    public TMProject getTMProject(final String id) {
        return dao.getTMProject(new Long(id));
    }

    /**
     * @see com.microweb.toastmaster.service.TMProjectManager#saveTMProject(TMProject tMProject)
     */
    public void saveTMProject(TMProject tMProject) {
        dao.saveTMProject(tMProject);
    }

    /**
     * @see com.microweb.toastmaster.service.TMProjectManager#removeTMProject(String id)
     */
    public void removeTMProject(final String id) {
        dao.removeTMProject(new Long(id));
    }
}
